import axios from 'axios'
import store from '@/store'

// const baseURL = 'http://161.117.83.241:5005/api/v1/'
// 生产环境
const baseURL = 'http://hq.nngcloud.com.cn/companion/api/v1/'
// 添加请求拦截器
axios.interceptors.request.use(function(config){
    //发送请求前
    
    let token = store.state.userInfo.token
    
    if(token){
        config.headers['Authorization']= "bearer " + token;
    }
    return config;
},function(error){
    return Promise.reject(error)
})

// 获取用户个人设置信息
export const personalInfo = params => {
    return axios.get(`${baseURL}personalization/all?vehicle_id=${params}`)
    .then(res => res.data)
}
